package com.server.pinggu.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.server.pinggu.mapper.SenTablesMapper;
import com.server.pinggu.domain.SenTables;
import com.server.pinggu.service.ISenTablesService;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ltao
 * @date 2022-10-23
 */
@Service
public class SenTablesServiceImpl extends ServiceImpl<SenTablesMapper, SenTables> implements ISenTablesService {

    @Override
    public List<SenTables> queryList(SenTables senTables) {
        LambdaQueryWrapper<SenTables> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(senTables.getName())){
            lqw.like(SenTables::getName ,senTables.getName());
        }
        if (senTables.getOrdering() != null){
            lqw.eq(SenTables::getOrdering ,senTables.getOrdering());
        }
        if (StringUtils.isNotBlank(senTables.getConn())){
            lqw.eq(SenTables::getConn ,senTables.getConn());
        }
        if (senTables.getAid() != null){
            lqw.eq(SenTables::getAid ,senTables.getAid());
        }
        return this.list(lqw);
    }
}